package it.codelair.bakekaservice.Utilities.sqllitemanager;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper{

	private static final int DATABASE_VERSION = 1;
	private static final String DATABASE_NAME = "CLBAKEKA";
	public static final String TABLE_NAME = "cl_companies";
	public static final String COLUMN_ID = "_id";
	private static final String DATABASE_CREATE_QUERY = "CREATE TABLE IF NOT EXISTS "+TABLE_NAME+" (_id,sip_address,business_name,logo,address,city,province,closed_day,points,discount,extra,site,map,category)";
	
	private static DBHelper helper;
	
	
	public static DBHelper getHelper(Context c){
        if(helper == null)
                helper = new DBHelper(c);
        
        return helper;
	}
	
	public DBHelper(Context c){
        super(c,DATABASE_NAME,null,DATABASE_VERSION);
	}
	
	@Override
    public void onCreate(SQLiteDatabase db) {
            db.execSQL(DATABASE_CREATE_QUERY);
            
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            // TODO Auto-generated method stub
            
    }
}
